﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DropDownList_Manage.aspx.cs"
    Inherits="SYS_POPEDOM_DropDownList_Manage" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../css/PageStyle.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../JavaScript/Common.js"></script>

    <script type="text/javascript">
        var SelectType = function(value) {
            var ret = "";
            if (value == '1')
                ret = "下拉数据";
            if (value == '2')
                ret = "lookup数据";
            return ret;
        }
        var DataSource = function(value) {
            var ret = "";
            if (value == '1')
                ret = "枚举";
            if (value == '2')
                ret = "SQl查询";
            return ret;
        }
        var DataType = function(value) {
            var ret = "";
            if (value == '1')
                ret = "系统";
            if (value == '2')
                ret = "客户";
            return ret;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" AjaxViewStateMode="Enabled" />
    <ext:Store ID="Store1" runat="server" AutoLoad="true" OnRefreshData="OnStoreRefreshData">
        <Proxy>
            <ext:PageProxy>
            </ext:PageProxy>
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="DROPDOWN_NAME">
                <Fields>
                    <ext:RecordField Name="DROPDOWN_NAME">
                    </ext:RecordField>
                    <ext:RecordField Name="SELECT_TYPE">
                    </ext:RecordField>
                    <ext:RecordField Name="DATA_SOURCE">
                    </ext:RecordField>
                    <ext:RecordField Name="DATA_CONTENT">
                    </ext:RecordField>
                    <ext:RecordField Name="DATA_TYPE">
                    </ext:RecordField>
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Viewport ID="ViewPort1" runat="server">
        <Content>
            <ext:RowLayout ID="RowLayout2" runat="server">
                <Rows>
                    <ext:LayoutRow>
                        <ext:Panel ID="Panel3" runat="server" Border="false" Height="120" Padding="5">
                            <TopBar>
                                <ext:Toolbar ID="Toolbar1" runat="server">
                                    <Items>
                                        <ext:Button ID="extBtn_Refresh" runat="server" Text="刷新" Icon="ArrowRefresh">
                                            <DirectEvents>
                                                <Click OnEvent="extBtn_Refresh_Click">
                                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{GridPanel1}" />
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                        <ext:Button ID="extBtn_Add" runat="server" Text="新增" Icon="Add">
                                        </ext:Button>
                                        <ext:Button ID="extBtn_Edit" runat="server" Text="修改" Icon="GroupEdit">
                                        </ext:Button>
                                        <ext:Button ID="extBtn_Delete" runat="server" Text="删除" Icon="Delete">
                                            <DirectEvents>
                                                <Click OnEvent="extBtn_Delete_Click">
                                                    <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{GridPanel1}" />
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                        <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                    </Items>
                                </ext:Toolbar>
                            </TopBar>
                            <Content>
                                <ext:FieldSet ID="FieldSet1" runat="server" Frame="true" Title="查询条件" Height="85"
                                    Layout="FitLayout">
                                    <Content>
                                        <ext:Container ID="Container1" runat="server" Layout="Column">
                                            <Items>
                                                <ext:Container ID="Container2" runat="server" LabelAlign="Right" Layout="Form" ColumnWidth=".5">
                                                    <Items>
                                                        <ext:TextField ID="exttxtf_dropdown_name" runat="server" TabIndex="1" AnchorHorizontal="0.95"
                                                            FieldLabel="下拉数据名称">
                                                        </ext:TextField>
                                                        <ext:ComboBox ID="extcomb_data_source" runat="server" Editable="false" TypeAhead="true"
                                                            FieldLabel="下拉数据来源" AnchorHorizontal="0.95" TabIndex="3">
                                                            <Items>
                                                                <ext:ListItem Text="" Value="0" />
                                                                <ext:ListItem Text="枚举" Value="1" />
                                                                <ext:ListItem Text="SQl查询" Value="2" />
                                                            </Items>
                                                        </ext:ComboBox>
                                                    </Items>
                                                </ext:Container>
                                                <ext:Container ID="Container5" runat="server" LabelAlign="Right" Layout="Form" ColumnWidth=".5">
                                                    <Items>
                                                        <ext:ComboBox ID="extcomb_select_type" runat="server" Editable="false" TypeAhead="true"
                                                            SelectedIndex="0" FieldLabel="下拉数据类型" AnchorHorizontal="0.95" TabIndex="2">
                                                            <Items>
                                                                <ext:ListItem Text="" Value="0" />
                                                                <ext:ListItem Value="1" Text="下拉数据" />
                                                                <ext:ListItem Value="2" Text="lookup数据" />
                                                            </Items>
                                                        </ext:ComboBox>
                                                        <ext:Panel ID="Panel1" runat="server" Border="false" AnchorHorizontal="0.95" ButtonAlign="Center">
                                                            <Content>
                                                                <table width="100%">
                                                                    <tr style="width: 100%">
                                                                        <td align="right">
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                        </td>
                                                                        <td align="right" width="50%">
                                                                            <ext:Button ID="Button3" runat="server" Text="查询" Icon="Find">
                                                                                <DirectEvents>
                                                                                    <Click OnEvent="OnBtnSearchClick">
                                                                                        <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{GridPanel1}" Msg="正在加载..." />
                                                                                    </Click>
                                                                                </DirectEvents>
                                                                            </ext:Button>
                                                                        </td>
                                                                        <td align="right">
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;
                                                                        </td>
                                                                        <td align="left" width="50%">
                                                                            <ext:Button ID="Button4" runat="server" Text="清空" Icon="BasketDelete">
                                                                                <Listeners>
                                                                                    <Click Handler="ClearCtrlValues2(Container1);" />
                                                                                </Listeners>
                                                                            </ext:Button>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </Content>
                                                        </ext:Panel>
                                                    </Items>
                                                </ext:Container>
                                            </Items>
                                        </ext:Container>
                                    </Content>
                                </ext:FieldSet>
                            </Content>
                        </ext:Panel>
                    </ext:LayoutRow>
                    <ext:LayoutRow RowHeight="1">
                        <ext:Panel ID="Panel4" runat="server" Border="false" BodyStyle="border-width:1 0 0 0px;" Layout="FitLayout">
                            <Content>
                                <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" AutoScroll="true" Border="false"
                                    TrackMouseOver="true" StripeRows="true" AutoExpandColumn="DATA_CONTENT">
                                    <ColumnModel ID="ColumnModel1" runat="server">
                                        <Columns>
                                            <ext:RowNumbererColumn Header="序号" Width="35" />
                                            <ext:Column Header="下拉项名称" DataIndex="DROPDOWN_NAME">
                                            </ext:Column>
                                            <ext:Column Header="下拉项类型" DataIndex="SELECT_TYPE">
                                                <Renderer Fn="SelectType" />
                                            </ext:Column>
                                            <ext:Column Header="数据来源" DataIndex="DATA_SOURCE">
                                                <Renderer Fn="DataSource" />
                                            </ext:Column>
                                            <ext:Column Header="下拉项内容" DataIndex="DATA_CONTENT">
                                            </ext:Column>
                                            <ext:Column Header="数据类型" DataIndex="DATA_TYPE">
                                                <Renderer Fn="DataType" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                    <SelectionModel>
                                        <ext:RowSelectionModel runat="server">
                                        </ext:RowSelectionModel>
                                    </SelectionModel>
                                    <LoadMask ShowMask="true" Msg="正在加载..." />
                                </ext:GridPanel>
                            </Content>
                        </ext:Panel>
                    </ext:LayoutRow>
                </Rows>
            </ext:RowLayout>
        </Content>
    </ext:Viewport>
    </form>
</body>
</html>
